"""meiduo_mall URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/2.2/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path,re_path
from . import views

urlpatterns = [
    path('admin/', admin.site.urls),
    # 用户名重复注册
    re_path(r'^usernames/(?P<username>[a-zA-Z0-9_-]{5,20})/count/$',views.UserNameCount.as_view()),
    # 手机号重复注册
    re_path(r'mobiles/(?P<mobile>1[3-9]\d{9})/count/$',views.MobelsCount.as_view()),
    # 用户注册接口
    re_path(r'register/$',views.Resgister.as_view()),
    # 用户登录接口
    re_path(r'^login/$', views.LoginView.as_view()),
    # 退出登录接口
    re_path(r'^logout/$', views.LogoutView.as_view()),
    # 用户中心接口
    re_path(r'^info/$', views.UserInfoView.as_view()),
    # 测试
    re_path(r'^get/$', views.GetView.as_view()),
    # 添加邮箱
    re_path(r'^emails/$', views.EmailView.as_view()),
    # 验证邮箱
    re_path(r'^emails/verification/$', views.EmailVerficationView.as_view()),
    # 修改密码
    re_path(r'^password/$', views.ChangePasswordView.as_view()),


]
